<%-- 
    Document   : donHangForm
    Created on : Oct 21, 2011, 2:14:22 AM
    Author     : nhlvu07db373
--%>
<%@page import="POJO.Chitietdonhang"%>
<%@page import="POJO.Donhang"%>
<%@page import="java.util.List"%>
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <div class="mnutitle"><span>Danh sách đơn đặt hàng</span></div>
    <div class="boxbody">
        <div class="danhsachsanpham">  
            <div class="sprows">
                <div class="sprowhd">
                    <div class="clrowstt"><span>STT</span></div>
                    <div class="clrowtsp"><span>Mã Đơn Hàng</span></div>
                    <div class="clrowlsp"><span>Email</span></div>
                    <div class="clrowgg"><span>Ngày Đặt</span></div>
                    <div class="clrowtxtt"><span>Chi Tiết</span></div>
                    <div class="clrowcn"><span>Chức Năng</span></div>
                </div>
            </div>
            <% List<Donhang> dsDH = (List<Donhang>) request.getAttribute("lstDH");
                List<Object> dslct = null;
                if (dsDH.size() > 0) {
                    dslct = (List<Object>) request.getAttribute("lstlct");
                }
                for (int i = 0; i < dsDH.size(); i++) {
                    Donhang dh = dsDH.get(i);
                    List<Chitietdonhang> dsctdh = (List<Chitietdonhang>) dslct.get(i);
            %>
            <div class="sprows">
                <div class="sprowt">
                    <div class="clrowstt"><%=i%></div>
                    <div class="clrowtsp"><%=dh.getMaDonHang()%></div>
                    <div class="clrowlsp"><%=dh.getEmail()%></div>
                    <div class="clrowgg"><%=dh.getNgayDatHang()%></div>
                    <div class="clrowtxtt"><table>
                            <tr><td>STT</td><td>Sản Phẩm</td><td>Số Lượng</td><td>Đơn Giá</td></tr>
                            <% for (int j = 0; j < dsctdh.size(); j++) {
                                    Chitietdonhang ctdh = dsctdh.get(i);
                            %>
                            <tr><td><%=j%></td><td><%=ctdh.getMaGianHang()%></td><td><%=ctdh.getSoLuong()%></td><td><%=ctdh.getDonGia()%></td></tr>
                            <%}%>
                        </table></div>
                    <div class="clrowcn"><div class="cnbutton"><a href="adminchapnhandathang.html?MaHD=<%=dh.getMaDonHang()%>">Đồng ý</a></div><div class="cnbutton"><a href="adminhuydatdat.html?MaHD=<%=dh.getMaDonHang()%>">Hủy</a></div></div>
                </div>
            </div>
            <% }%>
        </div>
    </div>
    <div class="mnutitle"><div class="cnhd"><a href="nhatkihoadon.html">Nhật Ký Hóa Đơn</a></div><div class="cnhd"><a href="lapphieugiaohang">Lập Phiếu Giao Hàng</a></div></div>
</html>
